﻿@model Planisoft.Entities.Trabajador

@{
    ViewBag.Title = "Edit";
}

<h2>Edit</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

@using (Html.BeginForm("Edit", "RecHum", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Editar Trabajador</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdTrabajador)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdTrabajador)
            @Html.ValidationMessageFor(model => model.IdTrabajador)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdNivelEducativo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdNivelEducativo)
            @Html.ValidationMessageFor(model => model.IdNivelEducativo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdNacionalidad)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdNacionalidad)
            @Html.ValidationMessageFor(model => model.IdNacionalidad)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdTipoDocumento)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdTipoDocumento)
            @Html.ValidationMessageFor(model => model.IdTipoDocumento)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdOcupacion)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdOcupacion)
            @Html.ValidationMessageFor(model => model.IdOcupacion)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.idUbiDpto)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.idUbiDpto)
            @Html.ValidationMessageFor(model => model.idUbiDpto)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdUbiProv)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdUbiProv)
            @Html.ValidationMessageFor(model => model.IdUbiProv)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdUbiDtto)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdUbiDtto)
            @Html.ValidationMessageFor(model => model.IdUbiDtto)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdVia)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdVia)
            @Html.ValidationMessageFor(model => model.IdVia)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.IdZona)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.IdZona)
            @Html.ValidationMessageFor(model => model.IdZona)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.NroDoc)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.NroDoc)
            @Html.ValidationMessageFor(model => model.NroDoc)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ApPaterno)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ApPaterno)
            @Html.ValidationMessageFor(model => model.ApPaterno)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.ApMaterno)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.ApMaterno)
            @Html.ValidationMessageFor(model => model.ApMaterno)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Nombre)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Nombre)
            @Html.ValidationMessageFor(model => model.Nombre)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.FechNacimiento)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FechNacimiento)
            @Html.ValidationMessageFor(model => model.FechNacimiento)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Telefono)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Telefono)
            @Html.ValidationMessageFor(model => model.Telefono)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Correo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Correo)
            @Html.ValidationMessageFor(model => model.Correo)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Sexo)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Sexo)
            @Html.ValidationMessageFor(model => model.Sexo)
        </div>

        <div class="editor-label">Foto</div>
        <div class="editor-field">
        @if (Model.foto == null) {
            @:None
        } else {
            <img width="150" height="150"
            src="@Url.Action("GetImage", "RecHum", new { Model.IdTrabajador })" />
        }
        <div>Subir Nueva Imagen: <input type="file" name="Image" /></div>
        </div>

        <p>
            <input type="submit" value="Save" />
        </p>
    </fieldset>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
